package com.ruoyi.basicsys.domain;

import com.ruoyi.basicsys.Ro.HouseholdRegisterRo;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.pojo.constant.RConst;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 用户管理对象 basic_user
 * 
 * @author ruoyi
 * @date 2024-07-25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BasicUser extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户id */
    private Long id;

    /** 用户姓名 */
    @Excel(name = "用户姓名")
    private String userName;

    /** 电话号码 */
    @Excel(name = "电话号码")
    private String phone;

    /** 用户密码 */
    @Excel(name = "用户密码")
    private String password;

    /** 性别 */
    @Excel(name = "性别")
    private String sex;

    /** 微信 */
    @Excel(name = "微信")
    private String wechat;

    /** 小区id */
    @Excel(name = "小区id")
    private String communityId;

    /** 小区名字 */
    @Excel(name = "小区名字")
    private String communityName;

    /** 楼栋id */
    @Excel(name = "楼栋id")
    private Long buildingId;

    /** 楼栋名字 */
    @Excel(name = "楼栋名字")
    private String buildingName;

    /** 地址 */
    @Excel(name = "地址")
    private String address;

    /** 类型： 0为管理员 1为普通用户 */
    @Excel(name = "类型： 0为管理员 1为普通用户")
    private String userStatus;

    /** 身份证 */
    @Excel(name = "身份证")
    private String identityCard;

    public static BasicUser HouseholdRegisterRoToBasicUser(HouseholdRegisterRo householdRegisterRo){

        BasicUser basicUser = new BasicUser();

        BeanUtils.copyProperties(householdRegisterRo,basicUser);
        //用户默认密码为：
        basicUser.setPassword(RConst.Str.PASSWORD);
        //设置用户姓名 ：用户姓名=住户姓名
        basicUser.setUserName(householdRegisterRo.getHouseholdName());
        return basicUser;
    }


}
